// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'axios'
import md5 from 'js-md5'
import $ from 'jquery'



import MuseUI from 'muse-ui';
import 'muse-ui/dist/muse-ui.css';
export const URL = 'http://img.readerday.com/cover/'
export const $URL = 'https://testapi.readerday.com/'

Vue.use(MuseUI);
Vue.prototype.md5 = md5
Vue.prototype.URL = URL
Vue.prototype.$URL = $URL
Vue.prototype.$ = $
Vue.prototype.$axios = axios
Vue.prototype.objKeySort = function (obj)  { //排序的函数
  var newkey = Object.keys(obj).sort();
  //先用Object内置类的keys方法获取要排序对象的属性名，再利用Array原型上的sort方法对获取的属性名进行排序，newkey是一个数组
  var newObj = '';//创建一个新的字符串，用于存放排好序的键值对
  for (var i = 0; i < newkey.length; i++) {//遍历newkey数组
    newObj+=[newkey[i]] +''+ obj[newkey[i]];//向新创建的对象中按照排好的顺序依次增加键值对

  }
  return newObj;//返回排好序的字符串
}//对象排序

Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
